package demo.data.mqRedis.controller;

import demo.data.mqRedis.config.RedisMessagePublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Action;

@RestController
@RequestMapping(value = "/redis")
public class Controller {

    @Autowired
    private RedisMessagePublisher redisMessagePublisher;

    @GetMapping("/mq")
    public String sendMq(){
        redisMessagePublisher.publish("hello kepler");
        return "ok";
    }
}
